1. Technical Field
The present invention is directed generally toward an improved data storage device. More particularly, the present invention relates to a method and apparatus in a data controller, that is included within a storage drive, for retrieving, evaluating, and processing a context that describes a direct memory access (DMA) request to transfer data between the storage drive and a host computer to which the storage drive is coupled.
2. Description of the Related Art
Contexts are known in the art. A context is generated for each DMA request to transfer data between a storage drive and a host computer to which the drive is coupled. The context includes all of the information that is necessary in order for a disk controller included in the drive to program a DMA transfer, whether that transfer is a read or a write. The context typically describes whether the transfer is to be a read or write to the drive, the length of the data to be transferred, and the current location of the data to be read or the space in the buffer where the data is to be written.
In order to transfer data between a storage drive and a host computer, an active protocol bus connection must exist between the drive and the computer. Thus, the drive and computer must have established an active communications link by completing the necessary handshaking process defined by the protocol. Once this handshaking process is successfully completed, an active link is open and data transmission between the disk and computer can begin.
There is computing overhead associated with establishing an active communications link. It is more efficient to transfer as much data as possible while a link is open instead of terminating one link, reestablishing another active link, and then transferring additional data.
The most efficient manner of executing a DMA request is to transfer all of the requested data at one time using one transfer instruction. This is typically not possible, however. The data is staged within the drive in a buffer for temporary storage as the data is transferred. This buffer may not be large enough to hold all of the requested data because only a segment of the buffer is allocated for use by any given DMA request. Thus, the space that is currently available in the buffer to be used for a particular DMA request will change dynamically as data is written into the buffer thus taking up buffer space or read from the buffer thus releasing space which causes buffer space to become available. When a DMA request is for an amount larger than the available space in a buffer segment, one solution is to divide the original single DMA request into multiple DMA requests so that the original single DMA request is executed in several smaller transfer instructions. Often a threshold is compared against the amount of space or data available in the buffer segment to define when it is most efficient to issue one of these smaller transfer instructions. Each transfer instruction is passed to a protocol block, which opens a communications link. The transfer instruction is then passed to a data movement block, often called a DMA block, to physically transfer the data to/from the buffer using the opened communications link. After the data movement for this instruction is complete, some information within the data movement block, including a buffer address pointer, is remembered and used as part of the next transfer instruction. This information is therefore not known until the data movement for the first transfer instruction has completed. This can provide a delay in cases where this information is needed to prepare the next instruction. As a result, this can impact performance, for example, by requiring that a communications link be opened for each one of these smaller requests and then closed after each one of the smaller requests is executed. Thus, for example, if an original DMA request is divided into three smaller requests, a communications link would be opened and closed three times.
Similarly, multiple related DMA requests may be received and queued into a single list to be executed. These DMA requests may be related, for example, by requesting data that is available in sequential locations in the buffer. These DMA requests may each be for a small amount of data, such that the data for multiple requests can all be stored in the buffer segment at the same moment. The most efficient manner of executing these DMA requests would be to open a single communications link, transfer the data for these multiple DMA requests, and then close the communications link. However, if feedback from the data movement block is needed to prepare each instruction, then delays occur on the communications link, and it may become more efficient to close the link between these instructions. Thus, for example, if three original DMA requests were received, a communications link would be opened and closed three times to avoid using the link inefficiently.
In new communication link protocols, the overhead to open a link is becoming less and more devices are needing to share the bandwidth of the link. As a result, inefficient use of the open communication link is less acceptable.
A need exists for a method and apparatus that will maximize the use of an established communications link when a DMA request is received by transmitting as much data as possible using the open link.